﻿<%@ Page Title="" Language="C#" MasterPageFile="~/administration/Admin.master" AutoEventWireup="true"
    CodeFile="RestoreCompanies.aspx.cs" Inherits="administration_Default2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="element">
        <label for="name">
            Company Name
        </label>
        <input id="txtCompanySearchName" runat="server" clientidmode="Static" name="name"
            class="text err" />
        <asp:Button ID="btnSearch" CssClass="button" Text="Find" runat="server" OnClick="btnSearch_Click" />
    </div>
    <asp:Label ID="lblCompNotFound" Text="Company not found" runat="server" ForeColor="Red"
        Visible="false" />
    <asp:GridView ID="gvCompanies" runat="server" AutoGenerateColumns="false" Visible="false"
        DataKeyNames="CompanyID" OnRowCommand="ReviewGridView_RowCommand">
        <Columns>
            <asp:BoundField DataField="CompanyID" HeaderText="ID" ControlStyle-Width="20px" />
            <asp:TemplateField HeaderText="Logo" ControlStyle-Width="51px">
                <ItemTemplate>
                    <asp:Image ID="Image1" ImageUrl='<%# GetImageDir()+Eval("Logo") %>' runat="server"
                        Width="50px" Height="50px" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="Name" HeaderText="Name" ControlStyle-Width="150px" />
            <asp:BoundField DataField="Rating" HeaderText="Rating" ControlStyle-Width="20px" />
            <asp:TemplateField HeaderText="Website" ControlStyle-Width="60px">
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" Target="_blank" NavigateUrl='<%# (Eval("Website") ?? "").ToString().StartsWith("http") ? Eval("Website") : "http"+Eval("Website") %>'
                        Text='<%# (Eval("Website") ?? "").ToString().Length < 15 ? (Eval("Website") ?? "").ToString():(Eval("Website") ?? "").ToString().Substring(0,15)%>'></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="ReviewsCount" HeaderText="Rws" ControlStyle-Width="20px" />
            <asp:TemplateField>
                <ItemTemplate>
                     <asp:LinkButton ID="LinkButton1" Text="აღადგინე" runat="server" CommandName="RestoreCommand" CommandArgument='<%# Container.DataItemIndex %>' />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
</asp:Content>
